<template>
    <view  class="erert">
      <web-view :src="urlhtml" class="dfsdyuwe" :style="{width:Width+'px',height:Height+'px'}"  @onPostMessage="message"></web-view>
	</view>
</template>
<script>
	var jsModule =  uni.requireNativePlugin("MyModule");
    export default {
        data() {
            return {
				Height:0,
				Width:0,
				urlhtml:"http://kuaixiong.youfai.cn/home/map/map.html",
				carstatusinitgps:{},
				devsn:0,
				urlbase:''
			}
        },
        components: {},
        methods: {
			 message(event){
				// console.log(event.detail.data);
				let data = event.detail.data[0]
				if(data.type == 1){
					// 寻车
					this.xunche()
				}
			},
			getcargps(reflash=false){
				let that = this
				// if (that.$store.state.isintcar){
					uni.showLoading({})
					let param = {}
					let timestamp=(new Date()).getTime()
					timestamp=timestamp.toString()
					console.log(timestamp);
					let nowtimestamp = timestamp.substr(0, timestamp.length - 4);
					let sttimestamp = parseInt(nowtimestamp)-100
					param.devCode = that.devsn
					param.startTime = sttimestamp
					param.endTime = nowtimestamp+5
					param.pageIndex = 1
					param.pageSize = 10
					uni.showModal({
						content:'获取位置:'+JSON.stringify(param)
					})
					uni.$emit('reallocation', {  
					    that: '我是title',  
					    content: '我是content'  
					});
					
				// }
			},
			rssical(code){
				if(code ==0 || code ==1){
					this.carstatusinitgps.sig = 1
				}else if(1<code <=5){
					this.inicarinfo.signal = 2
				}else if(5<code <=11){
					this.carstatusinitgps.sig = 3
				}else if(11<code <=17){
					this.carstatusinitgps.sig = 4
				}else if(17<code <=24){
					this.carstatusinitgps.sig = 5
				}else{
					this.carstatusinitgps.sig = 5
				}
			},
			xunche(){
				jsModule.sendCom('Cmd_Find_Car')
			}
		},
		onLoad(options) {
			// console.log(options);
			this.devsn = options.devsn
			let Longitude = options.Longitude
			let Latitude = options.Latitude
			let GnssDirection = options.GnssDirection
			let license = options.license
			this.urlhtml += '?Longitude='+Longitude+'&Latitude='+Latitude+'&devsn='+this.devsn+'&GnssDirection='+GnssDirection+'&license='+license
			uni.showToast({
				title:JSON.stringify(options)+'----'+this.urlhtml,
				icon:"icon"
			})
			// uni.showModal({
			// 	content:this.urlhtml
			// })
			// console.log(this.url);
			// this.currentcar()
			// this.getcargps(th)
		},
		onShow() {
			
		},
        mounted() {
			// console.log()
			this.Height = uni.getSystemInfoSync().windowHeight
			this.Width = uni.getSystemInfoSync().windowWidth
		}
    }

</script>
<style >
	.erert{
		background: #eee;
	}
	.dfsdyuwe{
		width: 100%;
		height: 100%;
	}
</style>
